import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
class AppendToFile
	{
	public static void main(String args[])
		{
		String s = "This content will be appended to the given file";
		try
			{
			File f = new File("xyz.txt");
			
			if(!f.exists())
				{
				f.createNewFile();
				}
			
			FileWriter fw = new FileWriter(f.getName(), true);
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(s);
			bw.close();
			
			System.out.println("Done");
			}
		catch(IOException ioe)
			{
			ioe.printStackTrace();
			}
		}
	}